using JamesFan.FetchAreaCodes.Repository;

namespace JamesFan.FetchAreaCodes.Consumer;

internal sealed class RepositoryConsumer : ICodeConsumer {
    public RepositoryConsumer(AbstractRepository repo) {
        Repo = repo;
    }

    AbstractRepository Repo { get; }

    public void Consume(CodeEntry entry) => Repo.AddEntry(entry);

    public void Consume(IEnumerable<CodeEntry> entries) => Repo.AddEntities(entries);
}
